package com.bckj.fastboot.iot.biz.controller;

import com.bckj.fastboot.core.lang.model.PageResult;
import com.bckj.fastboot.core.page.PageSupport;
import com.bckj.fastboot.iot.api.service.IotAlarmDataRemoteService;
import com.bckj.fastboot.iot.biz.service.IotAlarmDataQueryService;
import com.bckj.fastboot.iot.common.dto.query.IotAlarmDataQuery;
import com.bckj.fastboot.iot.common.dto.response.IotAlarmDataResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * IotAlarmDataController
 *
 * @author wfc
 **/
@RestController
@RequiredArgsConstructor
@RequestMapping("iotAlarmData")
public class IotAlarmDataController implements IotAlarmDataRemoteService {

    private final IotAlarmDataQueryService iotAlarmDataQueryService;

    @Override
    public IotAlarmDataResponse details(@PathVariable Long id) {
        return iotAlarmDataQueryService.details(id);
    }

    @Override
    public PageResult<IotAlarmDataResponse> page(IotAlarmDataQuery query) {
        return iotAlarmDataQueryService.page(PageSupport.buildPageable(), query);
    }
}
